Understanding how the SuiteQL Query Tool handles your data and protects your NetSuite environment.
The SuiteQL Query Tool is designed with security as a core principle. It operates entirely within your NetSuite environment, respects existing role-based permissions, and gives you complete control over any external integrations.
The tool is deployed as a SuiteScript Suitelet, running entirely within your NetSuite account. It does not require any external hosting or infrastructure.
Queries are executed using NetSuite's native N/query module, which enforces all standard NetSuite security policies and role restrictions.
The user interface runs in your browser. Settings and preferences are stored in your browser's local storage, not on any external servers.
The entire source code is contained in a single JavaScript file that you deploy. You can review, audit, and modify the code as needed.
Users can only query data their NetSuite role permits. The tool cannot bypass or escalate permissions.
AI-powered features can be completely disabled via configuration. When disabled, no AI-related code is rendered or accessible.
Understanding where your data goes is critical. Here's a comprehensive breakdown of data flow for each feature:
| Feature | Data Destination | External Transfer? |
|---|---|---|
| Query Execution | NetSuite database (via N/query module) | No - NetSuite Only |
| Query History | Browser localStorage | No - Local Only |
| Theme/Preferences | Browser localStorage | No - Local Only |
| Schema Explorer Data | Browser IndexedDB | No - Local Only |
| Excel/CSV Export | Downloaded to your computer | No - Local Only |
| AI Query Generation | AI provider API (user-initiated) | User Controlled |
| AI Query Explanation | AI provider API (user-initiated) | User Controlled |
| Tables Reference | NetSuite Records Catalog API | No - NetSuite Only |
| Google Sheets Export | Google Sheets API (via Service Account) | User Controlled |
| Plugin Execution | Depends on plugin code | Plugin Dependent |
The AI-powered features are entirely optional and can be disabled organization-wide by setting AI_ENABLED: false in the configuration section of the script.
The tool supports multiple AI providers. You choose which provider to use and provide your own API key:
The Google Sheets export feature allows you to send query results directly to Google Sheets. This feature uses Google Service Account authentication and requires careful security consideration.
The tool implements a pure JavaScript RSA-SHA256 JWT signing process because NetSuite's N/crypto module does not support RSA private key operations. This implementation:
| Mode | Required Permissions | Security Notes |
|---|---|---|
| Create New Spreadsheet | Full Drive API access | Service account can create files in its Drive space |
| Append to Existing | Sheets API only | Spreadsheet must be shared with service account email; lower permission footprint |
The tool uses your browser's local storage to persist settings and improve user experience. Here's what is stored:
| Storage Key | Purpose | Contains Sensitive Data? |
|---|---|---|
sqt_history |
Recent query history | May contain query text (not results) |
sqt_theme |
Light/dark mode preference | No |
sqt_draft |
Auto-saved editor content | May contain query text |
sqt_ai_settings |
AI provider selection and API key | Yes - API key if "Remember" enabled |
sqt_ai_conversation |
AI chat history | May contain prompts and responses |
sqt_params |
Last-used query parameter values | May contain parameter values |
sqt_gsheets_settings |
Google Sheets service account credentials | Yes - Service account private key if "Remember" enabled |
The SuiteQL Query Tool operates within NetSuite's existing security model:
The SuiteQL Query Tool supports a plugin architecture that allows extending functionality. While powerful, plugins require careful security consideration.
Server-side plugin hooks execute within NetSuite's SuiteScript environment and have significant capabilities:
| Hook | Timing | Capability |
|---|---|---|
onBeforeQuery |
Before query execution | Can modify, log, or reject queries before they run |
onAfterQuery |
After query execution | Can process, transform, or log results; can modify what is returned to the client |
onError |
When query fails | Can handle, log, or transform error messages |
Custom handlers |
On demand | Custom server endpoints that can perform any SuiteScript operation |
Client-side plugin hooks execute in the browser and can interact with the user interface:
| Hook | Timing | Capability |
|---|---|---|
onInit |
App initialization | Set up plugin state, inject UI elements |
onBeforeQuery |
Before query sent | Can modify or cancel queries from the client side |
onAfterQuery |
After results received | Can process results before display |
onResultsDisplay |
During rendering | Can customize how results are displayed |
onBeforeExport / onAfterExport |
Export lifecycle | Can intercept or modify export operations |
onEditorChange |
Editor updates | Can respond to query text changes |
To completely disable plugin loading, either:
PLUGIN_FOLDER_ID: '' in the CONFIG section (default)*.sqt-plugin.js filesWhen no plugins are configured, no plugin-related code executes and the tool operates in its default state.
| Component | Location | Security Implication |
|---|---|---|
| Plugin Files | NetSuite File Cabinet | Controlled by File Cabinet permissions |
| Plugin Settings | Browser localStorage + File Cabinet | Per-user, may contain sensitive configuration |
| Server-Side Code | Executes in NetSuite | Has access to NetSuite APIs and modules |
| Client-Side Code | Executes in Browser | Has access to DOM, localStorage, network |
No. Each user's query history, AI conversations, and settings are stored in their own browser's local storage. There is no shared storage or server-side logging of queries by the tool itself. (Note: NetSuite's standard audit logging may capture script executions.)
Your API key is stored only in your browser's localStorage and is transmitted directly to the AI provider over HTTPS. It is never sent to NetSuite servers or any other third party. For maximum security, you can uncheck "Remember my API key" to use session-only storage.
Yes. AI features can be completely disabled by setting AI_ENABLED: false in the configuration. When disabled, no AI-related UI elements are rendered, and no external API calls are possible.
No. The tool does not contain any analytics, telemetry, or "phone home" functionality. No data is sent to the tool's developer or any third party (except AI providers when you explicitly use AI features).
Yes. The entire tool is contained in a single JavaScript file that you deploy to your NetSuite File Cabinet. You have full visibility into all code and can review it before deployment.
Query sharing works by encoding your query text into the URL. Anyone with the URL can see the query text, but they can only execute it if they have access to your NetSuite account and appropriate permissions.
No. Schema Explorer builds a map of your database schema and stores it locally in your browser's IndexedDB. This data never leaves your browser and is only used to enhance autocomplete functionality.
Plugins should be treated like any third-party code. They execute with full privileges in both your browser and NetSuite environment. Only install plugins from trusted sources, and always review the source code before deployment. When in doubt, keep plugins disabled by leaving the PLUGIN_FOLDER_ID configuration empty.
Yes. Plugins can register hooks that intercept queries before execution and results after execution. This is by design to enable useful functionality like logging or data transformation. However, it means a malicious plugin could potentially capture or exfiltrate your data. This is why plugin source code review is essential.
The service account JSON key is handled similarly to AI API keys. When "Remember" is enabled, it is stored in your browser's localStorage. It is only transmitted to Google's OAuth endpoint (oauth2.googleapis.com) over HTTPS to obtain access tokens. The private key never leaves your browser except for this authentication process. For maximum security, uncheck "Remember" to use session-only storage, and consider using the "Append to Existing" export mode which requires fewer Google Cloud permissions.
Yes. When you use the Google Sheets export feature, your query results are transmitted to Google's servers and stored in Google Sheets. This is the intended purpose of the feature. Only use this feature if your organization's data policies permit sharing data with Google Cloud services. The "Append to Existing" mode allows you to control which spreadsheet receives the data by pre-sharing it with your service account.
This option allows you to connect to any API that implements the OpenAI API specification, including self-hosted models (Ollama), third-party aggregators (OpenRouter, Together AI), or enterprise deployments (Azure OpenAI). When using this option, you provide a custom base URL. The tool will send AI requests to whatever endpoint you specify. You are responsible for understanding the security and privacy implications of the endpoint you choose.